/**********************************************************
    COPYRIGHT
       LGX(c) 2011
    CLASS NAME
        platform_gcode.h
    DEPENDENCY

    HISTORY
		03/31/2012, created by Guangxing Liu
**********************************************************/
#ifndef PLATFORM_GCODE_H
#define PLATFORM_GCODE_H

#define GCODE_DEVICE           	 "GCODE"

#define GCODE_XVALUE_MARK 0x01
#define GCODE_YVALUE_MARK 0x02
#define GCODE_ZVALUE_MARK 0x04
#define GCODE_FVALUE_MARK 0x08
#define GCODE_TVALUE_MARK 0x10

#define GCODE_X_DIRECTION 0x01
#define GCODE_Y_DIRECTION 0x02
#define GCODE_Z_DIRECTION 0x04

#define MAX_PGB_BUFFER_LENGTH 512

#define platform_gcode_app_call_device_op_init    	         "0_init"
#define platform_gcode_app_call_device_op_write   	         "1_write"
#define platform_gcode_app_call_device_op_read	             "2_read"

typedef enum{
	Platform_Gcode_App_Call_None = 0,
	Platform_Gcode_App_Call_Gcode_Init,
	Platform_Gcode_App_Call_Gcode_Write,
	Platform_Gcode_App_Call_Gcode_Read
	
}platform_gcode_device_opt;

typedef struct _platform_gcode_app_call_
{
	platform_gcode_device_opt iOpt;
	
}platform_gcode_app_call;

typedef struct _decode_gcode_status_
{
	unsigned char operate;
	unsigned char v_mark;
	double x_value;
	double y_value;
	double z_value;
	double f_value;	
	double t_value;
	
}Decode_Gcode_Status;

typedef struct _platform_point_
{
	double x_value;
	double y_value;
	double z_value;
	
}platform_point;

typedef struct _platform_gcode_config_
{
	Decode_Gcode_Status dgs;	
	
}platform_gcode_config;

typedef enum
{
	DECODE_OPERATE_NONE=0,
	DECODE_G0,
	DECODE_G1,
	DECODE_G2,
	DECODE_G4,
	DECODE_G8=0x08,
	DECODE_G9,
	DECODE_G90=0x5A,
	DECODE_G91,
	DECODE_M0=0x64,
	DECODE_M1,
	DECODE_M2,
	DECODE_M3,
	DECODE_M4,
	DECODE_M5,
	DECODE_M6,
	DECODE_M7,
	DECODE_M8,
	DECODE_M9,
	DECODE_M10,
	DECODE_M99=199
}GCODE_OPERATE;

typedef struct _platform_point_long_
{
	long x;
	long y;
	long z;
}platform_point_long;


typedef struct _platform_gcode_buffer_
{
	unsigned char buse;
	unsigned char dir;
	platform_point_long point;
}platform_gcode_buffer;




























#endif
